package cn.fanyc.action.spring.cloud.action01.controller;

import cn.fanyc.action.spring.cloud.action01.model.OrderInfoBean;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;

/**
 * 订单管理
 *
 * @author Fanyc
 * @date 2019/12/6 22:05
 */
@RestController
@RequestMapping("/v1/order")
public class OrderController {

    /**
     * 获取订单信息
     *
     * @param orderId 订单ID
     * @return 订单信息
     */
    @GetMapping("/{orderId}")
    public OrderInfoBean getOrderInfo(@PathVariable("orderId") String orderId) {
        return new OrderInfoBean()
                .setOrderId(orderId)
                .setRemark("测试鱼的测试手机订单")
                .setUserId("1101")
                .setPrice(BigDecimal.valueOf(12.34));
    }
}
